{extend name="../../../view/public/base" /}
{block name="css"}
<style>
    .top-panel {
        border: 1px solid #eceff9;
        border-radius: 5px;
        text-align: center;
    }
    .top-panel > .layui-card-body{
        height: 60px;
    }
    .top-panel-number{
        line-height:60px;
        font-size: 30px;
        border-right:1px solid #eceff9;
    }
    .top-panel-tips{
        line-height:30px;
        font-size: 12px
    }

    .layui-card {border:1px solid #f2f2f2;border-radius:5px;}
    .icon {margin-right:10px;color:#1aa094;}
    .icon-cray {color:#ffb800!important;}
    .icon-blue {color:#1e9fff!important;}
    .icon-tip {color:#ff5722!important;}
    .layuimini-qiuck-module {text-align:center;margin-top: 10px}
    .layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
    .layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
    .welcome-module {width:100%;height:210px;}
    .panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
    .panel-body {padding:10px}
    .panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
    .label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top: .3em;}
    .layui-red {color:red}
    .main_btn > p {height:40px;}
    .layui-bg-number {background-color:#F8F8F8;}
    .layuimini-notice:hover {background:#f6f6f6;}
    .layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
    .layuimini-notice-title,.layuimini-notice-label {
        padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;}
    .layuimini-notice-title {line-height:28px;font-size:14px;}
    .layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
</style>
{/block}
{block name="body"}
<div class="layuimini-main">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md3">

            <div class="layui-card top-panel">
                <div class="layui-card-header">今日新增租户数量(累计数：<a style="color: #1aa094">{$data.member_total.all}</a>)</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5">
                        <div class="layui-col-xs9 layui-col-md6 top-panel-number">
                            {$data.member_total.today}
                        </div>
                        <div class="layui-col-xs3 layui-col-md6 top-panel-tips">
                            昨日数量 <a style="color: #1aa094">{$data.member_total.yesterday}</a><br>
                            前七日数量 <a style="color: #bd3004">{$data.member_total.week}</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="layui-col-xs12 layui-col-md3">

            <div class="layui-card top-panel">
                <div class="layui-card-header">今日新增用户数量(累计数：<a style="color: #1aa094">{$data.user_total.all}</a>)</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5">
                        <div class="layui-col-xs9 layui-col-md6 top-panel-number">
                            {$data.user_total.today}
                        </div>
                        <div class="layui-col-xs3 layui-col-md6 top-panel-tips">
                            昨日数量 <a style="color: #1aa094">{$data.user_total.yesterday}</a><br>
                            前七日数量 <a style="color: #bd3004">{$data.user_total.week}</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="layui-col-xs12 layui-col-md3">

            <div class="layui-card top-panel">
                <div class="layui-card-header">今日租户总充值(累计充值：<a style="color: #1aa094">{$data.recharge_total.all}</a>)</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5">
                        <div class="layui-col-xs9 layui-col-md6 top-panel-number">
                            {$data.recharge_total.today}
                        </div>
                        <div class="layui-col-xs3 layui-col-md6 top-panel-tips">
                            昨日充值 <a style="color: #1aa094">{$data.recharge_total.yesterday}</a><br>
                            前七日充值 <a style="color: #bd3004">{$data.recharge_total.week}</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="layui-col-xs12 layui-col-md3">

            <div class="layui-card top-panel">
                <div class="layui-card-header">今日租户购买应用数(累计数：<a style="color: #1aa094">{$data.app_total.all}</a>)</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5">
                        <div class="layui-col-xs9 layui-col-md6 top-panel-number">
                            {$data.app_total.today}
                        </div>
                        <div class="layui-col-xs3 layui-col-md6 top-panel-tips">
                            昨日数量 <a style="color: #1aa094">{$data.app_total.yesterday}</a><br>
                            前七日数量 <a style="color: #bd3004">{$data.app_total.week}</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="layuimini-main">
        <div class="layui-box">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header"><i class="fa fa-fire icon"></i>版本信息</div>
                        <div class="layui-card-body layui-text">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="100">
                                    <col>
                                </colgroup>
                                <tbody>
                                <tr>
                                    <td>框架名称</td>
                                    <td>
                                        bwsaas
                                    </td>
                                </tr>
                                <tr>
                                    <td>当前版本</td>
                                    <td>copyright@ <a href="http://www.buwangyun.com" target="_blank">布网云</a></td>
                                </tr>
                                <tr>
                                    <td>主要特色</td>
                                    <td>零门槛 / 响应式 / 清爽 / 极简</td>
                                </tr>
                                <tr>
                                    <td>演示地址</td>
                                    <td>
                                        (用户)租户后台：<a href="http://http://saas.buwangyun.com//manage/member/login" target="_blank">点击查看</a><br>
                                        (运营)平台后台：<a href="http://http://saas.buwangyun.com//manage/admin/login" target="_blank">点击查看</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>团队成员</td>
                                    <td>
                                        【韩。。。】  【聂。。。】   【焦。。。】  【马。。。】
                                    </td>
                                </tr>
                                <tr>
                                    <td>Gitee</td>
                                    <td style="padding-bottom: 0;">
                                        <div class="layui-btn-container">
                                            <a href="https://gitee.com/buwangyun/bwsaas" target="_blank" style="margin-right: 15px"><img src="https://gitee.com/buwangyun/bwsaas/badge/star.svg?theme=dark" alt="star"></a>
                                            <a href="https://gitee.com/buwangyun/bwsaas" target="_blank"><img src="https://gitee.com/buwangyun/bwsaas/badge/fork.svg?theme=dark" alt="fork"></a>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header"><i class="fa fa-fire icon"></i>系统信息</div>
                        <div class="layui-card-body layui-text">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="150">
                                    <col>
                                </colgroup>
                                <tbody>
                                <tr>
                                    <td>操作系统</td>
                                    <td>
                                        {$system_info.php_uname}
                                    </td>
                                </tr>
                                <tr>
                                    <td>PHP版本</td>
                                    <td>{$system_info.php_version}</td>
                                </tr>
                                <tr>
                                    <td>Zend版本</td>
                                    <td>{$system_info.zend_version}</td>
                                </tr>
                                <tr>
                                    <td>运行模式</td>
                                    <td>{$system_info.php_sapi_name}</td>
                                </tr>
                                <tr>
                                    <td>脚本最大使用内存</td>
                                    <td>{$system_info.max_memory}</td>
                                </tr>
                                <tr>
                                    <td>最大上传限制</td>
                                    <td>
                                        <?PHP echo get_cfg_var ("upload_max_filesize")?get_cfg_var ("upload_max_filesize"):"不允许上传附件"; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>最大执行时间</td>
                                    <td>
                                        <?PHP echo get_cfg_var("max_execution_time")."秒 "; ?>
                                    </td>
                                </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="layuimini-main">
        <div class="layui-box">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header"><i class="fa fa fa-sign-in icon"></i>登录日志(最近10条)</div>
                        <div class="layui-card-body layui-text">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="150">
                                    <col width="200">
                                    <col>
                                </colgroup>
                                <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>登录时间</th>
                                    <th>登录IP</th>
                                    <th>IP地址</th>
                                </tr>
                                </thead>
                                <tbody id = 'city_info'>
                                <tr>
                                    <td colspan="4" >调用SDK计算ip地址中...</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

<!--                <div class="layui-col-md6">-->
<!--                    <div class="layui-card">-->
<!--                        <div class="layui-card-header"><i class="fa fa-pencil icon icon-tip"></i>更新日志</div>-->
<!--                        <div class="layui-card-body layui-text">-->
<!--                            <ul class="layui-timeline">-->
<!--                                <li class="layui-timeline-item">-->
<!--                                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>-->
<!--                                    <div class="layui-timeline-content layui-text">-->
<!--                                        <h3 class="layui-timeline-title">2020年9日25日</h3>-->
<!--                                        <p>-->
<!--                                            上线布网商城应用1.0.2版本收费扩展-->
<!--                                            <br>新增拼团，秒杀，分销功能模块-->
<!--                                        </p>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                                <li class="layui-timeline-item">-->
<!--                                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>-->
<!--                                    <div class="layui-timeline-content layui-text">-->
<!--                                        <h3 class="layui-timeline-title">2020年9日20日</h3>-->
<!--                                        <p>-->
<!--                                            上线布网商城应用1.0.0版本-->
<!--                                            <br>官方开源应用-->
<!--                                            </p>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                                <li class="layui-timeline-item">-->
<!--                                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>-->
<!--                                    <div class="layui-timeline-content layui-text">-->
<!--                                        <h3 class="layui-timeline-title">2020年9日15日</h3>-->
<!--                                        <p>-->
<!--                                           bwsaas项目上线1.0.0版本-->
<!--                                        </p>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                                <li class="layui-timeline-item">-->
<!--                                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>-->
<!--                                    <div class="layui-timeline-content layui-text">-->
<!--                                        <div class="layui-timeline-title">过去</div>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                            </ul>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
            </div>
        </div>
    </div>
</div>
</div>
{/block}
{block name="js"}
<script>
    /**
     * 查看公告信息
     **/
    window.onload = function(){
        $('body').on('click', '.layuimini-notice', function () {
            var title = $(this).children('.layuimini-notice-title').text(),
                noticeTime = $(this).children('.layuimini-notice-extra').text(),
                content = $(this).children('.layuimini-notice-content').html();
            var html = '<div style="padding:15px 20px; text-align:justify; line-height: 22px;border-bottom:1px solid #e2e2e2;background-color: #2f4056;color: #ffffff">\n' +
                '<div style="text-align: center;margin-bottom: 20px;font-weight: bold;border-bottom:1px solid #718fb5;padding-bottom: 5px"><h4 class="text-danger">' + title + '</h4></div>\n' +
                '<div style="font-size: 12px">' + content + '</div>\n' +
                '</div>\n';
            parent.layer.open({
                type: 1,
                title: '系统公告'+'<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">'+noticeTime+'</span>',
                area: ['500px', '400px'],
                shade: 0.2,
                id: 'layuimini-notice',
                btn: ['查看', '取消'],
                btnAlign: 'c',
                moveType: 1,
                content:html,
                success: function (layero) {
                    // var btn = layero.find('.layui-layer-btn');
                    // btn.find('.layui-layer-btn0').attr({
                    //     href: 'https://gitee.com/buwangyun/dnmp',
                    //     target: '_blank'
                    // });
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                }
            });
        });



    }

    layui.use(['bwajax'], function () {
        var bwajax = layui.bwajax.instance();
            //退出登录逻辑
        bwajax.get('manage/admin/loginInfo').then(function (response) {
                if(response.data.data.errcode == 0){
                    console.log(response.data.data);
                    var data_list = response.data.data.data;
                    var html = '';
                    for(var i = 0; i < data_list.length; i++) {

                        html+='<tr>\n' +
                            '                                    <td>'+data_list[i].name+'</td>\n' +
                            '                                    <td>'+data_list[i].add_time_date+'</td>\n' +
                            '                                    <td >'+data_list[i].ip+'</td>\n' +
                            '                                    <td>'+data_list[i].city_name+'</td>\n' +
                            '                                </tr>';

                    };
                    if(data_list.length<1){
                        html =  ' <td colspan="4" >没有记录...</td>';
                    }
                    $('#city_info').html(html);

                }else{
                    layer.msg(response.data.msg);
                }
            }) .catch(function (error) {
                console.log(error);
            });
    });

</script>
{/block}

